home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Dialogs.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  22.8 KB  |  660 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Dialogs.p
  3.  
  4.      Contains:    Dialog Manager interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8.1
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT Dialogs;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __DIALOGS__}
  27. {$SETC __DIALOGS__ := 1}
  28.  
  29. {$I+}
  30. {$SETC DialogsIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __MIXEDMODE__}
  37. {$I MixedMode.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED __EVENTS__}
  40. {$I Events.p}
  41. {$ENDC}
  42. {$IFC UNDEFINED __MACWINDOWS__}
  43. {$I MacWindows.p}
  44. {$ENDC}
  45. {$IFC UNDEFINED __TEXTEDIT__}
  46. {$I TextEdit.p}
  47. {$ENDC}
  48. {$IFC UNDEFINED __CONTROLS__}
  49. {$I Controls.p}
  50. {$ENDC}
  51.  
  52.  
  53. {$PUSH}
  54. {$ALIGN MAC68K}
  55. {$LibExport+}
  56.  
  57.  
  58. CONST
  59.                                                                 {  errors & gestalt }
  60.     gestaltDialogMgrAttr        = 'dlog';
  61.     gestaltDialogMgrPresent        = $00000001;
  62.     dialogNoTimeoutErr            = -5640;
  63.  
  64.  
  65.                                                                 {  new, more standard names for dialog item types }
  66.     kControlDialogItem            = 4;
  67.     kButtonDialogItem            = 4;
  68.     kCheckBoxDialogItem            = 5;
  69.     kRadioButtonDialogItem        = 6;
  70.     kResourceControlDialogItem    = 7;
  71.     kStaticTextDialogItem        = 8;
  72.     kEditTextDialogItem            = 16;
  73.     kIconDialogItem                = 32;
  74.     kPictureDialogItem            = 64;
  75.     kUserDialogItem                = 0;
  76.     kItemDisableBit                = 128;
  77.  
  78.                                                                 {  old names for dialog item types }
  79.     ctrlItem                    = 4;
  80.     btnCtrl                        = 0;
  81.     chkCtrl                        = 1;
  82.     radCtrl                        = 2;
  83.     resCtrl                        = 3;
  84.     statText                    = 8;
  85.     editText                    = 16;
  86.     iconItem                    = 32;
  87.     picItem                        = 64;
  88.     userItem                    = 0;
  89.     itemDisable                    = 128;
  90.  
  91.                                                                 {  standard dialog item numbers }
  92.     kStdOkItemIndex                = 1;
  93.     kStdCancelItemIndex            = 2;                            {  old names }
  94.     ok                            = 1;
  95.     cancel                        = 2;
  96.  
  97.                                                                 {  standard icon resource id's      }
  98.     kStopIcon                    = 0;
  99.     kNoteIcon                    = 1;
  100.     kCautionIcon                = 2;                            {  old names }
  101.     stopIcon                    = 0;
  102.     noteIcon                    = 1;
  103.     cautionIcon                    = 2;
  104.  
  105.  
  106.  
  107.  
  108. {$IFC OLDROUTINENAMES }
  109. {
  110.    These constants lived briefly on ETO 16.  They suggest
  111.    that there is only one index you can use for the OK 
  112.    item, which is not true.  You can put the ok item 
  113.    anywhere you want in the DITL.
  114. }
  115.     kOkItemIndex                = 1;
  116.     kCancelItemIndex            = 2;
  117.  
  118. {$ENDC}  {OLDROUTINENAMES}
  119.  
  120. {    Dialog Item List Manipulation Constants    }
  121.  
  122. TYPE
  123.     DITLMethod                            = SInt16;
  124.  
  125. CONST
  126.     overlayDITL                    = 0;
  127.     appendDITLRight                = 1;
  128.     appendDITLBottom            = 2;
  129.  
  130.  
  131. TYPE
  132.     StageList                            = SInt16;
  133. {  DialogRef is obsolete. Use DialogPtr instead. }
  134.     DialogRef                            = DialogPtr;
  135.     DialogRecordPtr = ^DialogRecord;
  136.     DialogRecord = RECORD
  137.         window:                    WindowRecord;
  138.         items:                    Handle;
  139.         textH:                    TEHandle;
  140.         editField:                SInt16;
  141.         editOpen:                SInt16;
  142.         aDefItem:                SInt16;
  143.     END;
  144.  
  145.     DialogPeek                            = ^DialogRecord;
  146.     DialogTemplatePtr = ^DialogTemplate;
  147.     DialogTemplate = RECORD
  148.         boundsRect:                Rect;
  149.         procID:                    SInt16;
  150.         visible:                BOOLEAN;
  151.         filler1:                BOOLEAN;
  152.         goAwayFlag:                BOOLEAN;
  153.         filler2:                BOOLEAN;
  154.         refCon:                    SInt32;
  155.         itemsID:                SInt16;
  156.         title:                    Str255;
  157.     END;
  158.  
  159.     DialogTPtr                            = ^DialogTemplate;
  160.     DialogTHndl                            = ^DialogTPtr;
  161.     AlertTemplatePtr = ^AlertTemplate;
  162.     AlertTemplate = RECORD
  163.         boundsRect:                Rect;
  164.         itemsID:                SInt16;
  165.         stages:                    StageList;
  166.     END;
  167.  
  168.     AlertTPtr                            = ^AlertTemplate;
  169.     AlertTHndl                            = ^AlertTPtr;
  170. { new type abstractions for the dialog manager }
  171.     DialogItemIndexZeroBased            = SInt16;
  172.     DialogItemIndex                        = SInt16;
  173.     DialogItemType                        = SInt16;
  174. { dialog manager callbacks }
  175. {$IFC TYPED_FUNCTION_POINTERS}
  176.     SoundProcPtr = PROCEDURE(soundNumber: SInt16);
  177. {$ELSEC}
  178.     SoundProcPtr = ProcPtr;
  179. {$ENDC}
  180.  
  181. {$IFC TYPED_FUNCTION_POINTERS}
  182.     ModalFilterProcPtr = FUNCTION(theDialog: DialogPtr; VAR theEvent: EventRecord; VAR itemHit: DialogItemIndex): BOOLEAN;
  183. {$ELSEC}
  184.     ModalFilterProcPtr = ProcPtr;
  185. {$ENDC}
  186.  
  187. {$IFC TYPED_FUNCTION_POINTERS}
  188.     UserItemProcPtr = PROCEDURE(theWindow: WindowPtr; itemNo: DialogItemIndex);
  189. {$ELSEC}
  190.     UserItemProcPtr = ProcPtr;
  191. {$ENDC}
  192.  
  193.     SoundUPP = UniversalProcPtr;
  194.     ModalFilterUPP = UniversalProcPtr;
  195.     UserItemUPP = UniversalProcPtr;
  196.  
  197. CONST
  198.     uppSoundProcInfo = $00000080;
  199.     uppModalFilterProcInfo = $00000FD0;
  200.     uppUserItemProcInfo = $000002C0;
  201.  
  202. FUNCTION NewSoundProc(userRoutine: SoundProcPtr): SoundUPP;
  203.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  204.     INLINE $2E9F;
  205.     {$ENDC}
  206.  
  207. FUNCTION NewModalFilterProc(userRoutine: ModalFilterProcPtr): ModalFilterUPP;
  208.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  209.     INLINE $2E9F;
  210.     {$ENDC}
  211.  
  212. FUNCTION NewUserItemProc(userRoutine: UserItemProcPtr): UserItemUPP;
  213.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  214.     INLINE $2E9F;
  215.     {$ENDC}
  216.  
  217. PROCEDURE CallSoundProc(soundNumber: SInt16; userRoutine: SoundUPP);
  218.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  219.     INLINE $205F, $4E90;
  220.     {$ENDC}
  221.  
  222. FUNCTION CallModalFilterProc(theDialog: DialogPtr; VAR theEvent: EventRecord; VAR itemHit: DialogItemIndex; userRoutine: ModalFilterUPP): BOOLEAN;
  223.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  224.     INLINE $205F, $4E90;
  225.     {$ENDC}
  226.  
  227. PROCEDURE CallUserItemProc(theWindow: WindowPtr; itemNo: DialogItemIndex; userRoutine: UserItemUPP);
  228.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  229.     INLINE $205F, $4E90;
  230.     {$ENDC}
  231.  
  232. {$IFC NOT TARGET_OS_MAC }
  233. { QuickTime 3.0 }
  234.  
  235. TYPE
  236. {$IFC TYPED_FUNCTION_POINTERS}
  237.     QTModelessCallbackProcPtr = PROCEDURE(VAR theEvent: EventRecord; theDialog: DialogPtr; itemHit: DialogItemIndex); C;
  238. {$ELSEC}
  239.     QTModelessCallbackProcPtr = ProcPtr;
  240. {$ENDC}
  241.  
  242. PROCEDURE SetModelessDialogCallbackProc(theDialog: DialogPtr; callbackProc: QTModelessCallbackProcPtr);
  243. FUNCTION GetDialogControlNotificationProc(theProc: UNIV Ptr): OSErr;
  244. PROCEDURE SetDialogMovableModal(theDialog: DialogPtr);
  245. FUNCTION GetDialogParent(theDialog: DialogPtr): Ptr;
  246. {$ENDC}
  247.  
  248. {
  249.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  250.       • Following types are valid with Appearance 1.0 and later
  251.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  252. }
  253.  
  254. CONST
  255.                                                                 {  Alert types to pass into StandardAlert  }
  256.     kAlertStopAlert                = 0;
  257.     kAlertNoteAlert                = 1;
  258.     kAlertCautionAlert            = 2;
  259.     kAlertPlainAlert            = 3;
  260.  
  261.  
  262. TYPE
  263.     AlertType                            = SInt16;
  264.  
  265. CONST
  266.     kAlertDefaultOKText            = -1;                            {  "OK" }
  267.     kAlertDefaultCancelText        = -1;                            {  "Cancel" }
  268.     kAlertDefaultOtherText        = -1;                            {  "Don't Save" }
  269.  
  270. { StandardAlert alert button numbers }
  271.     kAlertStdAlertOKButton        = 1;
  272.     kAlertStdAlertCancelButton    = 2;
  273.     kAlertStdAlertOtherButton    = 3;
  274.     kAlertStdAlertHelpButton    = 4;
  275.  
  276.                                                                 {  Dialog Flags for use in NewFeaturesDialog or dlgx resource  }
  277.     kDialogFlagsUseThemeBackground = $01;
  278.     kDialogFlagsUseControlHierarchy = $02;
  279.     kDialogFlagsHandleMovableModal = $04;
  280.     kDialogFlagsUseThemeControls = $08;
  281.  
  282.                                                                 {  Alert Flags for use in alrx resource  }
  283.     kAlertFlagsUseThemeBackground = $01;
  284.     kAlertFlagsUseControlHierarchy = $02;
  285.     kAlertFlagsAlertIsMovable    = $04;
  286.     kAlertFlagsUseThemeControls    = $08;
  287.  
  288. { For dftb resource }
  289.     kDialogFontNoFontStyle        = 0;
  290.     kDialogFontUseFontMask        = $0001;
  291.     kDialogFontUseFaceMask        = $0002;
  292.     kDialogFontUseSizeMask        = $0004;
  293.     kDialogFontUseForeColorMask    = $0008;
  294.     kDialogFontUseBackColorMask    = $0010;
  295.     kDialogFontUseModeMask        = $0020;
  296.     kDialogFontUseJustMask        = $0040;
  297.     kDialogFontUseAllMask        = $00FF;
  298.     kDialogFontAddFontSizeMask    = $0100;
  299.     kDialogFontUseFontNameMask    = $0200;
  300.     kDialogFontAddToMetaFontMask = $0400;
  301.  
  302.  
  303. TYPE
  304.     AlertStdAlertParamRecPtr = ^AlertStdAlertParamRec;
  305.     AlertStdAlertParamRec = RECORD
  306.         movable:                BOOLEAN;                                {  Make alert movable modal  }
  307.         helpButton:                BOOLEAN;                                {  Is there a help button?  }
  308.         filterProc:                ModalFilterUPP;                            {  Event filter  }
  309.         defaultText:            StringPtr;                                {  Text for button in OK position  }
  310.         cancelText:                StringPtr;                                {  Text for button in cancel position  }
  311.         otherText:                StringPtr;                                {  Text for button in left position  }
  312.         defaultButton:            SInt16;                                    {  Which button behaves as the default  }
  313.         cancelButton:            SInt16;                                    {  Which one behaves as cancel (can be 0)  }
  314.         position:                UInt16;                                    {  Position (kWindowDefaultPosition in this case  }
  315.                                                                         {  equals kWindowAlertPositionParentWindowScreen)  }
  316.     END;
  317.  
  318.     AlertStdAlertParamPtr                = ^AlertStdAlertParamRec;
  319. {  ——— end Appearance 1.0 or later stuff }
  320.  
  321.  
  322.  
  323.  
  324.  
  325. {
  326.     NOTE: Code running under MultiFinder or System 7.0 or newer
  327.     should always pass NULL to InitDialogs.
  328. }
  329. PROCEDURE InitDialogs(ignored: UNIV Ptr);
  330.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  331.     INLINE $A97B;
  332.     {$ENDC}
  333. PROCEDURE ErrorSound(soundProc: SoundUPP);
  334.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  335.     INLINE $A98C;
  336.     {$ENDC}
  337. FUNCTION NewDialog(dStorage: UNIV Ptr; {CONST}VAR boundsRect: Rect; title: Str255; visible: BOOLEAN; procID: SInt16; behind: WindowPtr; goAwayFlag: BOOLEAN; refCon: SInt32; items: Handle): DialogPtr;
  338.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  339.     INLINE $A97D;
  340.     {$ENDC}
  341. FUNCTION GetNewDialog(dialogID: SInt16; dStorage: UNIV Ptr; behind: WindowPtr): DialogPtr;
  342.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  343.     INLINE $A97C;
  344.     {$ENDC}
  345. FUNCTION NewColorDialog(dStorage: UNIV Ptr; {CONST}VAR boundsRect: Rect; title: Str255; visible: BOOLEAN; procID: SInt16; behind: WindowPtr; goAwayFlag: BOOLEAN; refCon: SInt32; items: Handle): DialogPtr;
  346.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  347.     INLINE $AA4B;
  348.     {$ENDC}
  349. PROCEDURE CloseDialog(theDialog: DialogPtr);
  350.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  351.     INLINE $A982;
  352.     {$ENDC}
  353. PROCEDURE DisposeDialog(theDialog: DialogPtr);
  354.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  355.     INLINE $A983;
  356.     {$ENDC}
  357. PROCEDURE ModalDialog(modalFilter: ModalFilterUPP; VAR itemHit: DialogItemIndex);
  358.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  359.     INLINE $A991;
  360.     {$ENDC}
  361. FUNCTION IsDialogEvent({CONST}VAR theEvent: EventRecord): BOOLEAN;
  362.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  363.     INLINE $A97F;
  364.     {$ENDC}
  365. FUNCTION DialogSelect({CONST}VAR theEvent: EventRecord; VAR theDialog: DialogPtr; VAR itemHit: DialogItemIndex): BOOLEAN;
  366.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  367.     INLINE $A980;
  368.     {$ENDC}
  369. PROCEDURE DrawDialog(theDialog: DialogPtr);
  370.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  371.     INLINE $A981;
  372.     {$ENDC}
  373. PROCEDURE UpdateDialog(theDialog: DialogPtr; updateRgn: RgnHandle);
  374.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  375.     INLINE $A978;
  376.     {$ENDC}
  377. PROCEDURE HideDialogItem(theDialog: DialogPtr; itemNo: DialogItemIndex);
  378.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  379.     INLINE $A827;
  380.     {$ENDC}
  381. PROCEDURE ShowDialogItem(theDialog: DialogPtr; itemNo: DialogItemIndex);
  382.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  383.     INLINE $A828;
  384.     {$ENDC}
  385. FUNCTION FindDialogItem(theDialog: DialogPtr; thePt: Point): DialogItemIndexZeroBased;
  386.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  387.     INLINE $A984;
  388.     {$ENDC}
  389. PROCEDURE DialogCut(theDialog: DialogPtr);
  390. PROCEDURE DialogPaste(theDialog: DialogPtr);
  391. PROCEDURE DialogCopy(theDialog: DialogPtr);
  392. PROCEDURE DialogDelete(theDialog: DialogPtr);
  393. FUNCTION Alert(alertID: SInt16; modalFilter: ModalFilterUPP): DialogItemIndex;
  394.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  395.     INLINE $A985;
  396.     {$ENDC}
  397. FUNCTION StopAlert(alertID: SInt16; modalFilter: ModalFilterUPP): DialogItemIndex;
  398.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  399.     INLINE $A986;
  400.     {$ENDC}
  401. FUNCTION NoteAlert(alertID: SInt16; modalFilter: ModalFilterUPP): DialogItemIndex;
  402.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  403.     INLINE $A987;
  404.     {$ENDC}
  405. FUNCTION CautionAlert(alertID: SInt16; modalFilter: ModalFilterUPP): DialogItemIndex;
  406.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  407.     INLINE $A988;
  408.     {$ENDC}
  409. PROCEDURE GetDialogItem(theDialog: DialogPtr; itemNo: DialogItemIndex; VAR itemType: DialogItemType; VAR item: Handle; VAR box: Rect);
  410.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  411.     INLINE $A98D;
  412.     {$ENDC}
  413. PROCEDURE SetDialogItem(theDialog: DialogPtr; itemNo: DialogItemIndex; itemType: DialogItemType; item: Handle; {CONST}VAR box: Rect);
  414.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  415.     INLINE $A98E;
  416.     {$ENDC}
  417. PROCEDURE ParamText(param0: Str255; param1: Str255; param2: Str255; param3: Str255);
  418.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  419.     INLINE $A98B;
  420.     {$ENDC}
  421. PROCEDURE SelectDialogItemText(theDialog: DialogPtr; itemNo: DialogItemIndex; strtSel: SInt16; endSel: SInt16);
  422.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  423.     INLINE $A97E;
  424.     {$ENDC}
  425. PROCEDURE GetDialogItemText(item: Handle; VAR text: Str255);
  426.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  427.     INLINE $A990;
  428.     {$ENDC}
  429. PROCEDURE SetDialogItemText(item: Handle; text: Str255);
  430.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  431.     INLINE $A98F;
  432.     {$ENDC}
  433. FUNCTION GetAlertStage: SInt16;
  434.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  435.     INLINE $3EB8, $0A9A;
  436.     {$ENDC}
  437. PROCEDURE SetDialogFont(fontNum: SInt16);
  438.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  439.     INLINE $31DF, $0AFA;
  440.     {$ENDC}
  441. PROCEDURE ResetAlertStage;
  442.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  443.     INLINE $4278, $0A9A;
  444.     {$ENDC}
  445.  
  446. PROCEDURE AppendDITL(theDialog: DialogPtr; theHandle: Handle; method: DITLMethod);
  447. FUNCTION CountDITL(theDialog: DialogPtr): DialogItemIndex;
  448. PROCEDURE ShortenDITL(theDialog: DialogPtr; numberItems: DialogItemIndex);
  449. FUNCTION StdFilterProc(theDialog: DialogPtr; VAR event: EventRecord; VAR itemHit: DialogItemIndex): BOOLEAN;
  450. FUNCTION GetStdFilterProc(VAR theProc: ModalFilterUPP): OSErr;
  451.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  452.     INLINE $303C, $0203, $AA68;
  453.     {$ENDC}
  454. FUNCTION SetDialogDefaultItem(theDialog: DialogPtr; newItem: DialogItemIndex): OSErr;
  455.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  456.     INLINE $303C, $0304, $AA68;
  457.     {$ENDC}
  458. FUNCTION SetDialogCancelItem(theDialog: DialogPtr; newItem: DialogItemIndex): OSErr;
  459.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  460.     INLINE $303C, $0305, $AA68;
  461.     {$ENDC}
  462. FUNCTION SetDialogTracksCursor(theDialog: DialogPtr; tracks: BOOLEAN): OSErr;
  463.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  464.     INLINE $303C, $0306, $AA68;
  465.     {$ENDC}
  466.  
  467.  
  468. {
  469.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  470.       • Appearance Dialog Routines (available only with Appearance 1.0 and later)
  471.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  472. }
  473.  
  474. FUNCTION NewFeaturesDialog(inStorage: UNIV Ptr; {CONST}VAR inBoundsRect: Rect; inTitle: Str255; inIsVisible: BOOLEAN; inProcID: SInt16; inBehind: WindowPtr; inGoAwayFlag: BOOLEAN; inRefCon: SInt32; inItemListHandle: Handle; inFlags: UInt32): DialogPtr;
  475.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  476.     INLINE $303C, $110C, $AA68;
  477.     {$ENDC}
  478. FUNCTION AutoSizeDialog(inDialog: DialogPtr): OSErr;
  479.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  480.     INLINE $303C, $020D, $AA68;
  481.     {$ENDC}
  482. FUNCTION StandardAlert(inAlertType: AlertType; inError: StringPtr; inExplanation: StringPtr; inAlertParam: AlertStdAlertParamPtr; VAR outItemHit: SInt16): OSErr;
  483.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  484.     INLINE $303C, $090E, $AA68;
  485.     {$ENDC}
  486. FUNCTION GetDialogItemAsControl(inDialog: DialogPtr; inItemNo: SInt16; VAR outControl: ControlHandle): OSErr;
  487.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  488.     INLINE $303C, $050F, $AA68;
  489.     {$ENDC}
  490. FUNCTION MoveDialogItem(inDialog: DialogPtr; inItemNo: SInt16; inHoriz: SInt16; inVert: SInt16): OSErr;
  491.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  492.     INLINE $303C, $0510, $AA68;
  493.     {$ENDC}
  494. FUNCTION SizeDialogItem(inDialog: DialogPtr; inItemNo: SInt16; inWidth: SInt16; inHeight: SInt16): OSErr;
  495.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  496.     INLINE $303C, $0511, $AA68;
  497.     {$ENDC}
  498. FUNCTION AppendDialogItemList(dialog: DialogPtr; ditlID: SInt16; method: DITLMethod): OSErr;
  499.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  500.     INLINE $303C, $0412, $AA68;
  501.     {$ENDC}
  502. {
  503.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  504.       • Dialog Routines available only with Appearance 1.1 and later
  505.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  506. }
  507.  
  508. FUNCTION SetDialogTimeout(inDialog: DialogPtr; inButtonToPress: SInt16; inSecondsToWait: UInt32): OSStatus;
  509. FUNCTION GetDialogTimeout(inDialog: DialogPtr; VAR outButtonToPress: SInt16; VAR outSecondsToWait: UInt32; VAR outSecondsRemaining: UInt32): OSStatus;
  510. FUNCTION SetModalDialogEventMask(inDialog: DialogPtr; inMask: EventMask): OSStatus;
  511. FUNCTION GetModalDialogEventMask(inDialog: DialogPtr; VAR outMask: EventMask): OSStatus;
  512. {$IFC OLDROUTINENAMES }
  513. PROCEDURE DisposDialog(theDialog: DialogPtr);
  514.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  515.     INLINE $A983;
  516.     {$ENDC}
  517. PROCEDURE UpdtDialog(theDialog: DialogPtr; updateRgn: RgnHandle);
  518.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  519.     INLINE $A978;
  520.     {$ENDC}
  521. PROCEDURE GetDItem(theDialog: DialogPtr; itemNo: DialogItemIndex; VAR itemType: DialogItemType; VAR item: Handle; VAR box: Rect);
  522.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  523.     INLINE $A98D;
  524.     {$ENDC}
  525. PROCEDURE SetDItem(theDialog: DialogPtr; itemNo: DialogItemIndex; itemType: DialogItemType; item: Handle; {CONST}VAR box: Rect);
  526.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  527.     INLINE $A98E;
  528.     {$ENDC}
  529. PROCEDURE HideDItem(theDialog: DialogPtr; itemNo: DialogItemIndex);
  530.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  531.     INLINE $A827;
  532.     {$ENDC}
  533. PROCEDURE ShowDItem(theDialog: DialogPtr; itemNo: DialogItemIndex);
  534.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  535.     INLINE $A828;
  536.     {$ENDC}
  537. PROCEDURE SelIText(theDialog: DialogPtr; itemNo: DialogItemIndex; strtSel: SInt16; endSel: SInt16);
  538.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  539.     INLINE $A97E;
  540.     {$ENDC}
  541. PROCEDURE GetIText(item: Handle; VAR text: Str255);
  542.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  543.     INLINE $A990;
  544.     {$ENDC}
  545. PROCEDURE SetIText(item: Handle; text: Str255);
  546.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  547.     INLINE $A98F;
  548.     {$ENDC}
  549. FUNCTION FindDItem(theDialog: DialogPtr; thePt: Point): DialogItemIndexZeroBased;
  550.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  551.     INLINE $A984;
  552.     {$ENDC}
  553. FUNCTION NewCDialog(dStorage: UNIV Ptr; {CONST}VAR boundsRect: Rect; title: Str255; visible: BOOLEAN; procID: SInt16; behind: WindowPtr; goAwayFlag: BOOLEAN; refCon: SInt32; items: Handle): DialogPtr;
  554.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  555.     INLINE $AA4B;
  556.     {$ENDC}
  557. PROCEDURE DlgCut(theDialog: DialogPtr);
  558. PROCEDURE DlgPaste(theDialog: DialogPtr);
  559. PROCEDURE DlgCopy(theDialog: DialogPtr);
  560. PROCEDURE DlgDelete(theDialog: DialogPtr);
  561. PROCEDURE SetDAFont(fontNum: SInt16);
  562.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  563.     INLINE $31DF, $0AFA;
  564.     {$ENDC}
  565.  
  566.  
  567.  
  568. {$ENDC}  {OLDROUTINENAMES}
  569.  
  570. {
  571.     *****************************************************************************
  572.     *                                                                           *
  573.     * The conditional STRICT_DIALOGS has been removed from this interface file. *
  574.     * The accessor macros to a DialogRecord are no longer necessary.            *
  575.     *                                                                           *
  576.     * All ≈Ref Types have reverted to their original Handle and Ptr Types.      *
  577.     *                                                                           *
  578.     *****************************************************************************
  579.  
  580.     Details:
  581.     The original purpose of the STRICT_ conditionals and accessor macros was to
  582.     help ease the transition to Copland.  Shared data structures are difficult
  583.     to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  584.     WindowRecord and other data structures, we would begin the migration to the
  585.     discipline wherein system data structures are completely hidden from
  586.     applications.
  587.     
  588.     After many design reviews, we finally concluded that with this sort of
  589.     migration, the system could never tell when an application was no longer
  590.     peeking at a WindowRecord, and thus the data structure might never become
  591.     system owned.  Additionally, there were many other limitations in the
  592.     classic toolbox that were begging to be addressed.  The final decision was
  593.     to leave the traditional toolbox as a compatibility mode.
  594.     
  595.     We also decided to use the Handle and Ptr based types in the function
  596.     declarations.  For example, NewWindow now returns a WindowPtr rather than a
  597.     WindowRef.  The Ref types are still defined in the header files, so all
  598.     existing code will still compile exactly as it did before.  There are
  599.     several reasons why we chose to do this:
  600.     
  601.     - The importance of backwards compatibility makes it unfeasible for us to
  602.     enforce real opaque references in the implementation anytime in the
  603.     foreseeable future.  Therefore, any opaque data types (e.g. WindowRef,
  604.     ControlRef, etc.) in the documentation and header files would always be a
  605.     fake veneer of opacity.
  606.     
  607.     - There exists a significant base of books and sample code that neophyte
  608.     Macintosh developers use to learn how to program the Macintosh.  These
  609.     books and sample code all use direct data access.  Introducing opaque data
  610.     types at this point would confuse neophyte programmers more than it would
  611.     help them.
  612.     
  613.     - Direct data structure access is used by nearly all Macintosh developers. 
  614.     Changing the interfaces to reflect a false opacity would not provide any
  615.     benefit to these developers.
  616.     
  617.     - Accessor functions are useful in and of themselves as convenience
  618.     functions, without being tied to opaque data types.  We will complete and
  619.     document the Windows and Dialogs accessor functions in an upcoming release
  620.     of the interfaces.
  621. }
  622.  
  623. PROCEDURE CouldDialog(dialogID: SInt16);
  624.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  625.     INLINE $A979;
  626.     {$ENDC}
  627. PROCEDURE FreeDialog(dialogID: SInt16);
  628.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  629.     INLINE $A97A;
  630.     {$ENDC}
  631. PROCEDURE CouldAlert(alertID: SInt16);
  632.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  633.     INLINE $A989;
  634.     {$ENDC}
  635. PROCEDURE FreeAlert(alertID: SInt16);
  636.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  637.     INLINE $A98A;
  638.     {$ENDC}
  639.  
  640.  
  641.  
  642.  
  643. {$IFC NOT TARGET_OS_MAC }
  644. {$ENDC}
  645.  
  646.  
  647.  
  648.  
  649.  
  650. {$ALIGN RESET}
  651. {$POP}
  652.  
  653. {$SETC UsingIncludes := DialogsIncludes}
  654.  
  655. {$ENDC} {__DIALOGS__}
  656.  
  657. {$IFC NOT UsingIncludes}
  658.  END.
  659. {$ENDC}
  660.